using System;
using Microsoft.SPOT;
using System.Threading;
using NetduinoHappyHour.Hardware;
using NetduinoHappyHour.Util;

namespace NetduinoHappyHour.Behaviour
{
    /// <summary>
    /// Simple Behaviour, just moves around a little and goes back to startpoint
    /// </summary>
    public class Impatience : BaseBehaviour, IExecutable
    {
        public void Execute()
        {
            int stepsForthBack = SystemConfig.Instance().WheelRotation;
            int stepsLeftRight = SystemConfig.Instance().Rotate90 / 3;
            int delay = SystemConfig.Instance().DelayStepper;
            gw.ExecuteDriveCommand(new DriveCommand(-stepsLeftRight, stepsLeftRight, delay));
            gw.ExecuteDriveCommand(new DriveCommand(stepsLeftRight, -stepsLeftRight, delay));
            gw.ExecuteDriveCommand(new DriveCommand(stepsForthBack, stepsForthBack, delay));
            gw.ExecuteDriveCommand(new DriveCommand(-stepsForthBack, -stepsForthBack, delay));
            gw.ExecuteDriveCommand(new DriveCommand(-stepsLeftRight, stepsLeftRight, delay));
            gw.ExecuteDriveCommand(new DriveCommand(stepsLeftRight, -stepsLeftRight, delay));
        }
    }
}
